// static方法

class Person {
    constructor (name) {
        this.name = name
    }

    say () {
        console.log(`hi, my name is ${this.name}`);
    }

    static create (name) {
        //静态方法的this不会指向实例 而是类型
        return new Person(name)
    }
}

const tom = Person.create('tom')
tom.say()